package design.graduation.novelsystem.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import design.graduation.novelsystem.mapper.BookContentMapper;
import design.graduation.novelsystem.model.domian.BookContent;
import design.graduation.novelsystem.service.BookContentService;
import org.springframework.stereotype.Service;
/**
 * @author: 洪少尉
 * @Date: 2020/4/18 09:03
 * @Description: 
 */
@Service
public class BookContentServiceImpl extends ServiceImpl<BookContentMapper, BookContent> implements BookContentService{
	/**
	 * 小说上下架状态 内容更新
	 *
	 * @param id 小说id
	 * @param status 小说状态
	 */
	@Override
	public void updateNovelStatus(Integer id,Integer status) {
		UpdateWrapper<BookContent> updateWrapper = new UpdateWrapper<>();
		updateWrapper.eq(BookContent.COL_BOOK_ID,id)
				.set(BookContent.COL_AVAILABLE,status);
		this.update(updateWrapper);
	}
}
